<template>
	<view class="ShowModel" v-show="isVisible">
		<!-- 模态框内容 -->
		<view class="modal-content">
			<view class="header">
				<!-- title -->
				<text>{{title}}</text>
				<!-- 关闭按钮 -->
				<!-- <uni-icons type="close" size="20" @click="closeModal"></uni-icons> -->
			</view>
			<view class="main">
				<image src="../../static/images/NoContents.png" mode=""></image>
				<text>{{content}}</text>
			</view>
			<!-- foot -->
			<view class="feet">
				<button @click="closeModal">确认</button>
				<button @click="closeModal">取消</button>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				// axios接口所需参数
				startTime:'',  //参数 - 开始时间
				endTime:'',  //参数 - 结束时间
				title: '提示',
				content: '暂无内容',
				// showModal参数
				infos:[],
			}
		},
		updated() {
			let Datedata = uni.getStorageSync("chooseDate");
			let infos = uni.getStorageSync("infos");
			this.infos = infos
			this.startTime = Datedata[0].substring(0, 10)
			this.endTime = Datedata[1].substring(0, 10)
			this.content = this.startTime + '至' + this.endTime + '此时间段没有任何' + this.infos +'数据！'
			// console.log(this.startTime,this.endTime);
			// console.log(this.startTime = new Date(year, month - 1, day));
		},
		props: {
			isVisible: {
				type: Boolean,
				default: false
				
			}
		},
		methods: {
			closeModal() {
				this.$emit('update:isVisible', false);
			}
		}
	}
</script>

<style lang="scss">
	.ShowModel {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		justify-content: center;
		align-items: center;

	.modal-content {
		/* 设置背景图片 */
		background-image: url('@/static/images/NoContentsBg.png');
		background-size: cover;
		/* 背景图片覆盖整个盒子 */
		background-position: center;
		/* 背景图片居中 */
		height: 50%;
		width: 50%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		background-color: #fff;
		padding: 20px;
		border-radius: 8px;

		.header {
			text-align: center;
		}

		.main {
			margin-top: -18px;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			image {
				width: 60px;
				height: 40px;
			}

			text {
				display: flex;
				justify-content: center;
				align-items: center;
				text-align: center;
				flex-wrap: wrap;
				font-size: 18px;
				margin-top: 12px;
				// font-weight: 600;
				/*设置渐变的方向从左到右 颜色从***到***/
				 background: linear-gradient(to left, #b6b6b6, #55557f); 
				  -webkit-background-clip: text;/*将设置的背景颜色限制在文字中*/
				  -webkit-text-fill-color: transparent;/*给文字设置成透明*/
			}

		}

		.feet {

			display: flex;
			width: 100%;
			justify-content: space-evenly;

			button {
				font-size: 10px;
				}
			}
		}
		
	}
</style>